package com.lsk.common;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.jfinal.plugin.redis.Cache;
import com.jfinal.plugin.redis.Redis;
import com.lsk.alipay.constants.AlipayServiceEnvConstants;
import com.lsk.util.Syslog;

import java.util.List;

/**
 * 系统启动之后
 */
public class RunAfter {

    public  RunAfter(){

        Cache cache= Redis.use();

        String sql="SELECT *from sys_config";

        List<Record> list= Db.find(sql);

        for (int i=0;i<list.size();i++){
            try {

                String key="sys_config";

                Record temp=new Record();

                key+=temp.getStr("element");

                String value=temp.getStr("value");

                cache.set(key,value);

            }catch (Exception e){

                Syslog.error(e);
            }

        }




    }
}
